package com.aier.admin.action;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import net.eicp.ghostboy.futil.RandomUtil;

import org.aspectj.util.FileUtil;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.aier.admin.entity.CaiPu;
import com.aier.admin.entity.CaiXi;
import com.aier.admin.entity.GongYi;
import com.aier.admin.entity.KouWei;
import com.aier.admin.entity.NanDu;
import com.aier.admin.entity.ZhuLiao;
import com.aier.admin.service.IAdminCaiPuService;
import com.aier.common.common.Constant;
import com.aier.common.common.SystemConfigStatic;
import com.aier.common.dao.ICommonDAO;

@Scope("prototype")
@Component("adminCaiPuAction")
public class AdminCaiPuAction extends AdminBaseAction {

    private static final long serialVersionUID = 1L;
    @Resource(name = "adminCaiPuService")
    private IAdminCaiPuService adminCaiPuService;

    // 页数
    private int page;
    // 每页显示记录数
    private int page_size;
    // 总页数
    private int page_count;
    // 总数
    private int count;
    // 错误码
    private int s;
    // 错误信息
    private String error_info;
    // 排序方式
    private String sord;
    // 排序字段
    private String sort;

    private File file0_0, file1_1, file1_2,file1_3,file1_4,file1_5,file1_6,file1_7,file1_8,file1_9,file1_10,
    file2_1, file2_2,file2_3,file2_4,file2_5,file2_6,file2_7,file2_8,file2_9,file2_10,
    file3_1, file3_2,file3_3,file3_4,file3_5,file3_6,file3_7,file3_8,file3_9,file3_10,
    file4_1, file4_2,file4_3,file4_4,file4_5,file4_6,file4_7,file4_8,file4_9,file4_10,
    file5_1, file5_2,file5_3,file5_4,file5_5,file5_6,file5_7,file5_8,file5_9,file5_10,
    file6_1, file6_2,file6_3,file6_4,file6_5,file6_6,file6_7,file6_8,file6_9,file6_10,
    file7_1, file7_2,file7_3,file7_4,file7_5,file7_6,file7_7,file7_8,file7_9,file7_10,
    file8_1, file8_2,file8_3,file8_4,file8_5,file8_6,file8_7,file8_8,file8_9,file8_10,
    file9_1, file9_2,file9_3,file9_4,file9_5,file9_6,file9_7,file9_8,file9_9,file9_10,
    file10_1, file10_2,file10_3,file10_4,file10_5,file10_6,file10_7,file10_8,file10_9,file10_10,
    file11_1, file11_2,file11_3,file11_4,file11_5,file11_6,file11_7,file11_8,file11_9,file11_10,
    file12_1, file12_2,file12_3,file12_4,file12_5,file12_6,file12_7,file12_8,file12_9,file12_10,
    file13_1, file13_2,file13_3,file13_4,file13_5,file13_6,file13_7,file13_8,file13_9,file13_10,
    file14_1, file14_2,file14_3,file14_4,file14_5,file14_6,file14_7,file14_8,file14_9,file14_10,
    file15_1, file15_2,file15_3,file15_4,file15_5,file15_6,file15_7,file15_8,file15_9,file15_10,
    file16_1, file16_2,file16_3,file16_4,file16_5,file16_6,file16_7,file16_8,file16_9,file16_10,
    file17_1, file17_2,file17_3,file17_4,file17_5,file17_6,file17_7,file17_8,file17_9,file17_10,
    file18_1, file18_2,file18_3,file18_4,file18_5,file18_6,file18_7,file18_8,file18_9,file18_10,
    file19_1, file19_2,file19_3,file19_4,file19_5,file19_6,file19_7,file19_8,file19_9,file19_10,
    fileZL;
    private String imgUrl = SystemConfigStatic.caipu_get_url;

    // 添加菜谱的条件:工艺,难度,菜系,口味
    private String gy_name_add;
    private String nd_name_add;
    private String cx_name_add;
    private String kw_name_add;
    
    // 图片名
    private String imgName;
    // 菜谱序号
    private int num;
    // 步奏序号
    private int rownum;
    // 步奏图片序号
    private int cellnum;
    // 工艺列表
    private List<GongYi> gongyiList;
    // 口味列表
    private List<KouWei> kouweiList;
    // 难度列表
    private List<NanDu> nanduList;
    // 菜系列表
    private List<CaiXi> caixiList;
    // 主料列表
    private List<ZhuLiao> zhuliaoList;
    // 菜谱列表
    private List<CaiPu> caipuList;    
    // 添加菜单,名字,说明,时间,菜系,难度,口味,主图片,主料,辅料,步奏,
    private String cp_name;
    private String cp_desc;
    private String cp_time;
    private String cp_ptime;
    private String cp_number;
    private long cx_id = -1;
    private long nd_id = -1;
    private long gy_id = -1;
    private long kw_id = -1;
    private String cp_img;
    private String zhuliaos;
    private String fuliaos;
    private String buzous;
    
    private long cp_id_del;
    private long gy_id_del;
    private long nd_id_del;
    private long cx_id_del;
    private long kw_id_del;
    // 菜谱修改
    private CaiPu caipu;    
    // 主料修改
    private ZhuLiao zhuliao;
    private long zl_id;
    private String zl_img;
    
    List<String> image_str_list;
    
    @Override
    public String execute() {
        gongyiList = adminCaiPuService.searchGongYiList();
        kouweiList = adminCaiPuService.searchKouWeiList();
        nanduList = adminCaiPuService.searchNanDuList();
        caixiList = adminCaiPuService.searchCaiXiList();
        if(cp_id_del!=0){
            caipu = adminCaiPuService.searchCaiPuById(cp_id_del);
        }
        
        return SUCCESS;
    }
    /**
     * 查询数据库所有图片
     * @return
     */
    public String searchAllImage() {
        image_str_list = adminCaiPuService.searchTest();
        return SUCCESS;
    }

    /**
     * 查询菜谱信息
     * @return
     */
    @SuppressWarnings("unchecked")
    public String search(){
        if(page<=0){
            page=1;
        }
        int sortable=-1;
        if("cp_time".equals(sort)){
            sortable = ("asc".equals(sord))?IAdminCaiPuService.CAIPU_SORTABLE_TIME:IAdminCaiPuService.CAIPU_SORTABLE_TIME_DESC;
        }
        List<Long> zl_ids = new ArrayList<Long>();
        
        Map<String,Object> map = adminCaiPuService.searchCaiPuListByCondition(page,IAdminCaiPuService.CAIPU_LIST_PAGESIZE,
                sortable,cp_name,cp_time,cx_id,nd_id,gy_id,kw_id,zl_ids);
        if(null==map){
            s=Constant.num_1000;
            return ERROR;
        }
        caipuList = (List<CaiPu>) map.get(ICommonDAO.OBJ_LIST);
        if (null == caipuList) {
            s = 0;
            return SUCCESS;
        }
        page = (Integer) map.get(ICommonDAO.PAGE);
        page_size = (Integer) map.get(ICommonDAO.PAGE_SIZE);
        page_count = (Integer) map.get(ICommonDAO.PAGE_COUNT);
        count = (Integer) map.get(ICommonDAO.COUNT);        
        
        
        return SUCCESS;
    }
    
    /**
     * 加载工艺
     * @return
     */
    @SuppressWarnings("unchecked")
    public String loadGongYi(){
        if(page<=0){
            page=1;
        }
        Map<String,Object> map = adminCaiPuService.searchGongYiList(page,IAdminCaiPuService.CAIPU_LIST_PAGESIZE);
        if(null==map){
            s=Constant.num_1000;
            return ERROR;
        }
        gongyiList = (List<GongYi>) map.get(ICommonDAO.OBJ_LIST);
        if (null == gongyiList) {
            s = 0;
            return SUCCESS;
        }
        page = (Integer) map.get(ICommonDAO.PAGE);
        page_size = (Integer) map.get(ICommonDAO.PAGE_SIZE);
        page_count = (Integer) map.get(ICommonDAO.PAGE_COUNT);
        count = (Integer) map.get(ICommonDAO.COUNT);         
        return SUCCESS;
    }

    /**
     * 加载难度
     * @return
     */
    @SuppressWarnings("unchecked")
    public String loadNanDu(){
        if(page<=0){
            page=1;
        }
        Map<String,Object> map = adminCaiPuService.searchNanDuList(page,IAdminCaiPuService.CAIPU_LIST_PAGESIZE);
        if(null==map){
            s=Constant.num_1000;
            return ERROR;
        }
        nanduList = (List<NanDu>) map.get(ICommonDAO.OBJ_LIST);
        if (null == nanduList) {
            s = 0;
            return SUCCESS;
        }
        page = (Integer) map.get(ICommonDAO.PAGE);
        page_size = (Integer) map.get(ICommonDAO.PAGE_SIZE);
        page_count = (Integer) map.get(ICommonDAO.PAGE_COUNT);
        count = (Integer) map.get(ICommonDAO.COUNT);         
        return SUCCESS;
    }
    
    /**
     * 加载菜系
     * @return
     */
    @SuppressWarnings("unchecked")
    public String loadCaiXi(){
        if(page<=0){
            page=1;
        }
        Map<String,Object> map = adminCaiPuService.searchCaiXiList(page,IAdminCaiPuService.CAIPU_LIST_PAGESIZE);
        if(null==map){
            s=Constant.num_1000;
            return ERROR;
        }
        caixiList = (List<CaiXi>) map.get(ICommonDAO.OBJ_LIST);
        if (null == caixiList) {
            s = 0;
            return SUCCESS;
        }
        page = (Integer) map.get(ICommonDAO.PAGE);
        page_size = (Integer) map.get(ICommonDAO.PAGE_SIZE);
        page_count = (Integer) map.get(ICommonDAO.PAGE_COUNT);
        count = (Integer) map.get(ICommonDAO.COUNT);         
        return SUCCESS;
    }
    
    /**
     * 加载口味
     * @return
     */
    @SuppressWarnings("unchecked")
    public String loadKouWei(){
        if(page<=0){
            page=1;
        }
        Map<String,Object> map = adminCaiPuService.searchKouWeiList(page,IAdminCaiPuService.CAIPU_LIST_PAGESIZE);
        if(null==map){
            s = Constant.num_1000;
            return ERROR;
        }
        kouweiList = (List<KouWei>) map.get(ICommonDAO.OBJ_LIST);
        if (null == kouweiList) {
            s = 0;
            return SUCCESS;
        }
        page = (Integer) map.get(ICommonDAO.PAGE);
        page_size = (Integer) map.get(ICommonDAO.PAGE_SIZE);
        page_count = (Integer) map.get(ICommonDAO.PAGE_COUNT);
        count = (Integer) map.get(ICommonDAO.COUNT);         
        return SUCCESS;
    }
    
    /**
     * 加载主料
     */
    @SuppressWarnings("unchecked")
    public String loadZhuLiao(){
        if(page<=0){
            page=1;
        }
        Map<String,Object> map = adminCaiPuService.searchZhuLiaoList(page,IAdminCaiPuService.CAIPU_LIST_PAGESIZE);
        if(null==map){
            s = Constant.num_1000;
            return ERROR;
        }
        zhuliaoList = (List<ZhuLiao>) map.get(ICommonDAO.OBJ_LIST);
        if (null == zhuliaoList) {
            s = 0;
            return SUCCESS;
        }
        page = (Integer) map.get(ICommonDAO.PAGE);
        page_size = (Integer) map.get(ICommonDAO.PAGE_SIZE);
        page_count = (Integer) map.get(ICommonDAO.PAGE_COUNT);
        count = (Integer) map.get(ICommonDAO.COUNT);         
        return SUCCESS;
    }
    
    /**
     * 加载要修改的主料
     * @return
     */
    public String showZhuLiao(){
        zhuliao = adminCaiPuService.searchZhuLiaoById(zl_id);
        return SUCCESS;
    }
    /**
     * 修改主料图片
     * @return
     */
    public String updateZhuLiao(){
        s = adminCaiPuService.updateZhuLiao(zl_id,zl_img);
        return SUCCESS;
    }
    
    /**
     *  添加菜谱
     * @return
     */
    public String addCaiPu() {
        try {
            cp_desc = cp_desc.replace("\n", "<br/>");
            buzous = buzous.replace("\n", "<br/>");
            s = adminCaiPuService.insertCaipu(cp_name,cp_desc,cp_time,cp_ptime,cp_number,cx_id,nd_id,gy_id,kw_id,cp_img,zhuliaos,fuliaos,buzous);  
        } catch (Exception e) {
            error_info = e.toString();
            s = 0;
        }
        return SUCCESS;
    }
    
    /**
     *  修改菜谱
     * @return
     */
    public String updateCaiPu() {
        try {
            cp_desc = cp_desc.replace("\n", "<br/>");
            buzous = buzous.replace("\n", "<br/>");
            s = adminCaiPuService.updateCaipu(cp_id_del,cp_name,cp_desc,cp_time,cp_ptime,cp_number,
                    cx_id,nd_id,gy_id,kw_id,cp_img,zhuliaos,fuliaos,buzous);  
        } catch (Exception e) {
            e.printStackTrace();
            s = 0;
        }
        return SUCCESS;
    }

    /**
     * 添加工艺
     * @return
     */
    public String addGongYi(){
        GongYi gongyi = adminCaiPuService.searchGongYiByName(gy_name_add);
        if(gongyi!=null){
            s = 0;
            error_info = "工艺名 " + gy_name_add + " 已存在";
        }else{
            s = adminCaiPuService.insertGongYi(gy_name_add);
        }
        return SUCCESS;
    }
    
    /**
     * 添加难度
     * @return
     */
    public String addNanDu(){
        NanDu nandu = adminCaiPuService.searchNanDuByName(nd_name_add);
        if(nandu!=null){
            s = 0;
            error_info = "难度名 " + nd_name_add + " 已存在";
        }else{
            s = adminCaiPuService.insertNanDu(nd_name_add);
        }
        return SUCCESS;
    }
    
    /**
     * 添加菜系
     * @return
     */
    public String addCaiXi(){
        CaiXi caixi = adminCaiPuService.searchCaiXiByName(cx_name_add);
        if(caixi!=null){
            s = 0;
            error_info = "板块名 " + cx_name_add + " 已存在";
        }else{
            s = adminCaiPuService.insertCaiXi(cx_name_add);
        }
        return SUCCESS;
    }
    
    /**
     * 添加口味
     * @return
     */
    public String addKouWei(){
        KouWei kouwei = adminCaiPuService.searchKouWeiByName(kw_name_add);
        if(kouwei!=null){
            s = 0;
            error_info = "口味名 " + kw_name_add + " 已存在";
        }else{
            s = adminCaiPuService.insertKouWei(kw_name_add);
        }
        return SUCCESS;
    }
    
    /**
     *  删除菜谱
     * @return
     */
    public String delete() {
        s = adminCaiPuService.deleteCaiPu(cp_id_del);
        return SUCCESS;
    }

    /**
     *  删除工艺
     * @return
     */
    public String deleteGY() {
        s = adminCaiPuService.deleteGongYi(gy_id_del);
        return SUCCESS;
    }
    
    /**
     *  删除难度
     * @return
     */
    public String deleteND() {
        s = adminCaiPuService.deleteNanDu(nd_id_del);
        return SUCCESS;
    }
    
    /**
     *  删除菜系
     * @return
     */
    public String deleteCX() {
        s = adminCaiPuService.deleteCaiXi(cx_id_del);
        return SUCCESS;
    }
    
    /**
     *  删除口味
     * @return
     */
    public String deleteKW() {
        s = adminCaiPuService.deleteKouWei(kw_id_del);
        return SUCCESS;
    }
    
    /**
     * 上传菜谱照片
     * @return
     */
    public String upfile() {
        File file = findFile(rownum,cellnum);
        if(rownum==0){
            imgName = "cp" + num + "_" + RandomUtil.genRandomNum(Constant.num_8, RandomUtil.PWD_TYPE_NUM_AND_CHAR) + ".jpg";
        }else if(rownum==-1){
            imgName = "zl" + num + "_" + RandomUtil.genRandomNum(Constant.num_8, RandomUtil.PWD_TYPE_NUM_AND_CHAR) + ".jpg";
        }else{
            imgName = "cp" + num + "_bz" + rownum + "_" + RandomUtil.genRandomNum(Constant.num_8, RandomUtil.PWD_TYPE_NUM_AND_CHAR) + ".jpg";
        }
        
        try {
            FileUtil.copyFile(file, new File(SystemConfigStatic.caipu_upload_url + imgName));
        } catch (IOException e) {
            e.printStackTrace();
        }
        s = 1;
        return SUCCESS;
    }
    
    private File findFile(int rownum2,int cellnum2) {
        switch(rownum2){
            case -1:
                return fileZL;
            case 0:
                return file0_0;
            case 1:
                switch(cellnum2){
                    case 1:
                        return file1_1;
                    case 2:
                        return file1_2;
                    case Constant.num_3:
                        return file1_3;
                    case Constant.num_4:
                        return file1_4;
                    case Constant.num_5:
                        return file1_5;
                    case Constant.num_6:
                        return file1_6;
                    case Constant.num_7:
                        return file1_7;
                    case Constant.num_8:
                        return file1_8;
                    case Constant.num_9:
                        return file1_9;
                    case Constant.num_10:
                        return file1_10;
                }
            case 2:
                switch(cellnum2){
                    case 1:
                        return file2_1;
                    case 2:
                        return file2_2;
                    case Constant.num_3:
                        return file2_3;
                    case Constant.num_4:
                        return file2_4;
                    case Constant.num_5:
                        return file2_5;
                    case Constant.num_6:
                        return file2_6;
                    case Constant.num_7:
                        return file2_7;
                    case Constant.num_8:
                        return file2_8;
                    case Constant.num_9:
                        return file2_9;
                    case Constant.num_10:
                        return file2_10;
                }
            case Constant.num_3:
                switch(cellnum2){
                    case 1:
                        return file3_1;
                    case 2:
                        return file3_2;
                    case Constant.num_3:
                        return file3_3;
                    case Constant.num_4:
                        return file3_4;
                    case Constant.num_5:
                        return file3_5;
                    case Constant.num_6:
                        return file3_6;
                    case Constant.num_7:
                        return file3_7;
                    case Constant.num_8:
                        return file3_8;
                    case Constant.num_9:
                        return file3_9;
                    case Constant.num_10:
                        return file3_10;
                }
            case Constant.num_4:
                switch(cellnum2){
                    case 1:
                        return file4_1;
                    case 2:
                        return file4_2;
                    case Constant.num_3:
                        return file4_3;
                    case Constant.num_4:
                        return file4_4;
                    case Constant.num_5:
                        return file4_5;
                    case Constant.num_6:
                        return file4_6;
                    case Constant.num_7:
                        return file4_7;
                    case Constant.num_8:
                        return file4_8;
                    case Constant.num_9:
                        return file4_9;
                    case Constant.num_10:
                        return file4_10;
                }
            case Constant.num_5:
                switch(cellnum2){
                    case 1:
                        return file5_1;
                    case 2:
                        return file5_2;
                    case Constant.num_3:
                        return file5_3;
                    case Constant.num_4:
                        return file5_4;
                    case Constant.num_5:
                        return file5_5;
                    case Constant.num_6:
                        return file5_6;
                    case Constant.num_7:
                        return file5_7;
                    case Constant.num_8:
                        return file5_8;
                    case Constant.num_9:
                        return file5_9;
                    case Constant.num_10:
                        return file5_10;
                }
            case Constant.num_6:
                switch(cellnum2){
                    case 1:
                        return file6_1;
                    case 2:
                        return file6_2;
                    case Constant.num_3:
                        return file6_3;
                    case Constant.num_4:
                        return file6_4;
                    case Constant.num_5:
                        return file6_5;
                    case Constant.num_6:
                        return file6_6;
                    case Constant.num_7:
                        return file6_7;
                    case Constant.num_8:
                        return file6_8;
                    case Constant.num_9:
                        return file6_9;
                    case Constant.num_10:
                        return file6_10;
                }
            case Constant.num_7:
                switch(cellnum2){
                    case 1:
                        return file7_1;
                    case 2:
                        return file7_2;
                    case Constant.num_3:
                        return file7_3;
                    case Constant.num_4:
                        return file7_4;
                    case Constant.num_5:
                        return file7_5;
                    case Constant.num_6:
                        return file7_6;
                    case Constant.num_7:
                        return file7_7;
                    case Constant.num_8:
                        return file7_8;
                    case Constant.num_9:
                        return file7_9;
                    case Constant.num_10:
                        return file7_10;
                }
            case Constant.num_8:
                switch(cellnum2){
                    case 1:
                        return file8_1;
                    case 2:
                        return file8_2;
                    case Constant.num_3:
                        return file8_3;
                    case Constant.num_4:
                        return file8_4;
                    case Constant.num_5:
                        return file8_5;
                    case Constant.num_6:
                        return file8_6;
                    case Constant.num_7:
                        return file8_7;
                    case Constant.num_8:
                        return file8_8;
                    case Constant.num_9:
                        return file8_9;
                    case Constant.num_10:
                        return file8_10;
                }
            case Constant.num_9:
                switch(cellnum2){
                    case 1:
                        return file9_1;
                    case 2:
                        return file9_2;
                    case Constant.num_3:
                        return file9_3;
                    case Constant.num_4:
                        return file9_4;
                    case Constant.num_5:
                        return file9_5;
                    case Constant.num_6:
                        return file9_6;
                    case Constant.num_7:
                        return file9_7;
                    case Constant.num_8:
                        return file9_8;
                    case Constant.num_9:
                        return file9_9;
                    case Constant.num_10:
                        return file9_10;
                }
            case Constant.num_10:
                switch(cellnum2){
                    case 1:
                        return file10_1;
                    case 2:
                        return file10_2;
                    case Constant.num_3:
                        return file10_3;
                    case Constant.num_4:
                        return file10_4;
                    case Constant.num_5:
                        return file10_5;
                    case Constant.num_6:
                        return file10_6;
                    case Constant.num_7:
                        return file10_7;
                    case Constant.num_8:
                        return file10_8;
                    case Constant.num_9:
                        return file10_9;
                    case Constant.num_10:
                        return file10_10;
                }
            case Constant.num_11:
                switch(cellnum2){
                    case 1:
                        return file11_1;
                    case 2:
                        return file11_2;
                    case Constant.num_3:
                        return file11_3;
                    case Constant.num_4:
                        return file11_4;
                    case Constant.num_5:
                        return file11_5;
                    case Constant.num_6:
                        return file11_6;
                    case Constant.num_7:
                        return file11_7;
                    case Constant.num_8:
                        return file11_8;
                    case Constant.num_9:
                        return file11_9;
                    case Constant.num_10:
                        return file11_10;
                }
            case Constant.num_12:
                switch(cellnum2){
                    case 1:
                        return file12_1;
                    case 2:
                        return file12_2;
                    case Constant.num_3:
                        return file12_3;
                    case Constant.num_4:
                        return file12_4;
                    case Constant.num_5:
                        return file12_5;
                    case Constant.num_6:
                        return file12_6;
                    case Constant.num_7:
                        return file12_7;
                    case Constant.num_8:
                        return file12_8;
                    case Constant.num_9:
                        return file12_9;
                    case Constant.num_10:
                        return file12_10;
                }
            case Constant.num_13:
                switch(cellnum2){
                    case 1:
                        return file13_1;
                    case 2:
                        return file13_2;
                    case Constant.num_3:
                        return file13_3;
                    case Constant.num_4:
                        return file13_4;
                    case Constant.num_5:
                        return file13_5;
                    case Constant.num_6:
                        return file13_6;
                    case Constant.num_7:
                        return file13_7;
                    case Constant.num_8:
                        return file13_8;
                    case Constant.num_9:
                        return file13_9;
                    case Constant.num_10:
                        return file13_10;
                }
            case Constant.num_14:
                switch(cellnum2){
                    case 1:
                        return file14_1;
                    case 2:
                        return file14_2;
                    case Constant.num_3:
                        return file14_3;
                    case Constant.num_4:
                        return file14_4;
                    case Constant.num_5:
                        return file14_5;
                    case Constant.num_6:
                        return file14_6;
                    case Constant.num_7:
                        return file14_7;
                    case Constant.num_8:
                        return file14_8;
                    case Constant.num_9:
                        return file14_9;
                    case Constant.num_10:
                        return file14_10;
                }
            case Constant.num_15:
                switch(cellnum2){
                    case 1:
                        return file15_1;
                    case 2:
                        return file15_2;
                    case Constant.num_3:
                        return file15_3;
                    case Constant.num_4:
                        return file15_4;
                    case Constant.num_5:
                        return file15_5;
                    case Constant.num_6:
                        return file15_6;
                    case Constant.num_7:
                        return file15_7;
                    case Constant.num_8:
                        return file15_8;
                    case Constant.num_9:
                        return file15_9;
                    case Constant.num_10:
                        return file15_10;
                }
            case Constant.num_16:
                switch(cellnum2){
                    case 1:
                        return file16_1;
                    case 2:
                        return file16_2;
                    case Constant.num_3:
                        return file16_3;
                    case Constant.num_4:
                        return file16_4;
                    case Constant.num_5:
                        return file16_5;
                    case Constant.num_6:
                        return file16_6;
                    case Constant.num_7:
                        return file16_7;
                    case Constant.num_8:
                        return file16_8;
                    case Constant.num_9:
                        return file16_9;
                    case Constant.num_10:
                        return file16_10;
                }
            case Constant.num_17:
                switch(cellnum2){
                    case 1:
                        return file17_1;
                    case 2:
                        return file17_2;
                    case Constant.num_3:
                        return file17_3;
                    case Constant.num_4:
                        return file17_4;
                    case Constant.num_5:
                        return file17_5;
                    case Constant.num_6:
                        return file17_6;
                    case Constant.num_7:
                        return file17_7;
                    case Constant.num_8:
                        return file17_8;
                    case Constant.num_9:
                        return file17_9;
                    case Constant.num_10:
                        return file17_10;
                }
            case Constant.num_18:
                switch(cellnum2){
                    case 1:
                        return file18_1;
                    case 2:
                        return file18_2;
                    case Constant.num_3:
                        return file18_3;
                    case Constant.num_4:
                        return file18_4;
                    case Constant.num_5:
                        return file18_5;
                    case Constant.num_6:
                        return file18_6;
                    case Constant.num_7:
                        return file18_7;
                    case Constant.num_8:
                        return file18_8;
                    case Constant.num_9:
                        return file18_9;
                    case Constant.num_10:
                        return file18_10;
                }
            case Constant.num_19:
                switch(cellnum2){
                    case 1:
                        return file19_1;
                    case 2:
                        return file19_2;
                    case Constant.num_3:
                        return file19_3;
                    case Constant.num_4:
                        return file19_4;
                    case Constant.num_5:
                        return file19_5;
                    case Constant.num_6:
                        return file19_6;
                    case Constant.num_7:
                        return file19_7;
                    case Constant.num_8:
                        return file19_8;
                    case Constant.num_9:
                        return file19_9;
                    case Constant.num_10:
                        return file19_10;
                }
        }
        return null;
    }
    
    
    

    public int getPage() {
        return page;
    }


    public void setPage(int page) {
        this.page = page;
    }


    public int getPage_size() {
        return page_size;
    }


    public int getPage_count() {
        return page_count;
    }


    public int getCount() {
        return count;
    }


    public int getS() {
        return s;
    }


    public void setSord(String sord) {
        this.sord = sord;
    }


    public void setSort(String sort) {
        this.sort = sort;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public String getError_info() {
        return error_info;
    }

    public String getImgUrl() {
        return imgUrl;
    }


    public void setAdminCaiPuService(IAdminCaiPuService adminCaiPuService) {
        this.adminCaiPuService = adminCaiPuService;
    }

    public void setFile0_0(File file0_0) {
        this.file0_0 = file0_0;
    }

    public void setRownum(int rownum) {
        this.rownum = rownum;
    }

    public void setCp_name(String cp_name) {
        this.cp_name = cp_name;
    }

    public void setCp_desc(String cp_desc) {
        this.cp_desc = cp_desc;
    }

    public void setCp_time(String cp_time) {
        this.cp_time = cp_time;
    }

    public void setCx_id(long cx_id) {
        this.cx_id = cx_id;
    }

    public void setNd_id(long nd_id) {
        this.nd_id = nd_id;
    }

    public void setGy_id(long gy_id) {
        this.gy_id = gy_id;
    }

    public void setKw_id(long kw_id) {
        this.kw_id = kw_id;
    }

    public void setCp_img(String cp_img) {
        this.cp_img = cp_img;
    }

    public void setZhuliaos(String zhuliaos) {
        this.zhuliaos = zhuliaos;
    }

    public void setFuliaos(String fuliaos) {
        this.fuliaos = fuliaos;
    }

    public void setBuzous(String buzous) {
        this.buzous = buzous;
    }

    public void setCp_id_del(long cp_id_del) {
        this.cp_id_del = cp_id_del;
    }

    public List<GongYi> getGongyiList() {
        return gongyiList;
    }

    public List<KouWei> getKouweiList() {
        return kouweiList;
    }

    public List<NanDu> getNanduList() {
        return nanduList;
    }

    public List<CaiXi> getCaixiList() {
        return caixiList;
    }

    public List<CaiPu> getCaipuList() {
        return caipuList;
    }

    public String getImgName() {
        return imgName;
    }

    public CaiPu getCaipu() {
        return caipu;
    }

    public void setGy_name_add(String gy_name_add) {
        this.gy_name_add = gy_name_add;
    }

    public void setNd_name_add(String nd_name_add) {
        this.nd_name_add = nd_name_add;
    }

    public void setCx_name_add(String cx_name_add) {
        this.cx_name_add = cx_name_add;
    }

    public void setKw_name_add(String kw_name_add) {
        this.kw_name_add = kw_name_add;
    }

    public void setGy_id_del(long gy_id_del) {
        this.gy_id_del = gy_id_del;
    }

    public void setNd_id_del(long nd_id_del) {
        this.nd_id_del = nd_id_del;
    }

    public void setCx_id_del(long cx_id_del) {
        this.cx_id_del = cx_id_del;
    }

    public void setKw_id_del(long kw_id_del) {
        this.kw_id_del = kw_id_del;
    }

    public void setCp_ptime(String cp_ptime) {
        this.cp_ptime = cp_ptime;
    }

    public void setCp_number(String cp_number) {
        this.cp_number = cp_number;
    }

    public List<ZhuLiao> getZhuliaoList() {
        return zhuliaoList;
    }

    public ZhuLiao getZhuliao() {
        return zhuliao;
    }

    public void setZl_id(long zl_id) {
        this.zl_id = zl_id;
    }

    public void setZl_img(String zl_img) {
        this.zl_img = zl_img;
    }

    public void setFileZL(File fileZL) {
        this.fileZL = fileZL;
    }

    public void setCellnum(int cellnum) {
        this.cellnum = cellnum;
    }

    public void setFile1_1(File file1_1) {
        this.file1_1 = file1_1;
    }

    public void setFile1_2(File file1_2) {
        this.file1_2 = file1_2;
    }

    public void setFile1_3(File file1_3) {
        this.file1_3 = file1_3;
    }

    public void setFile1_4(File file1_4) {
        this.file1_4 = file1_4;
    }

    public void setFile1_5(File file1_5) {
        this.file1_5 = file1_5;
    }

    public void setFile1_6(File file1_6) {
        this.file1_6 = file1_6;
    }

    public void setFile1_7(File file1_7) {
        this.file1_7 = file1_7;
    }

    public void setFile1_8(File file1_8) {
        this.file1_8 = file1_8;
    }

    public void setFile1_9(File file1_9) {
        this.file1_9 = file1_9;
    }

    public void setFile1_10(File file1_10) {
        this.file1_10 = file1_10;
    }

    public void setFile2_1(File file2_1) {
        this.file2_1 = file2_1;
    }

    public void setFile2_2(File file2_2) {
        this.file2_2 = file2_2;
    }

    public void setFile2_3(File file2_3) {
        this.file2_3 = file2_3;
    }

    public void setFile2_4(File file2_4) {
        this.file2_4 = file2_4;
    }

    public void setFile2_5(File file2_5) {
        this.file2_5 = file2_5;
    }

    public void setFile2_6(File file2_6) {
        this.file2_6 = file2_6;
    }

    public void setFile2_7(File file2_7) {
        this.file2_7 = file2_7;
    }

    public void setFile2_8(File file2_8) {
        this.file2_8 = file2_8;
    }

    public void setFile2_9(File file2_9) {
        this.file2_9 = file2_9;
    }

    public void setFile2_10(File file2_10) {
        this.file2_10 = file2_10;
    }

    public void setFile3_1(File file3_1) {
        this.file3_1 = file3_1;
    }

    public void setFile3_2(File file3_2) {
        this.file3_2 = file3_2;
    }

    public void setFile3_3(File file3_3) {
        this.file3_3 = file3_3;
    }

    public void setFile3_4(File file3_4) {
        this.file3_4 = file3_4;
    }

    public void setFile3_5(File file3_5) {
        this.file3_5 = file3_5;
    }

    public void setFile3_6(File file3_6) {
        this.file3_6 = file3_6;
    }

    public void setFile3_7(File file3_7) {
        this.file3_7 = file3_7;
    }

    public void setFile3_8(File file3_8) {
        this.file3_8 = file3_8;
    }

    public void setFile3_9(File file3_9) {
        this.file3_9 = file3_9;
    }

    public void setFile3_10(File file3_10) {
        this.file3_10 = file3_10;
    }

    public void setFile4_1(File file4_1) {
        this.file4_1 = file4_1;
    }

    public void setFile4_2(File file4_2) {
        this.file4_2 = file4_2;
    }

    public void setFile4_3(File file4_3) {
        this.file4_3 = file4_3;
    }

    public void setFile4_4(File file4_4) {
        this.file4_4 = file4_4;
    }

    public void setFile4_5(File file4_5) {
        this.file4_5 = file4_5;
    }

    public void setFile4_6(File file4_6) {
        this.file4_6 = file4_6;
    }

    public void setFile4_7(File file4_7) {
        this.file4_7 = file4_7;
    }

    public void setFile4_8(File file4_8) {
        this.file4_8 = file4_8;
    }

    public void setFile4_9(File file4_9) {
        this.file4_9 = file4_9;
    }

    public void setFile4_10(File file4_10) {
        this.file4_10 = file4_10;
    }

    public void setFile5_1(File file5_1) {
        this.file5_1 = file5_1;
    }

    public void setFile5_2(File file5_2) {
        this.file5_2 = file5_2;
    }

    public void setFile5_3(File file5_3) {
        this.file5_3 = file5_3;
    }

    public void setFile5_4(File file5_4) {
        this.file5_4 = file5_4;
    }

    public void setFile5_5(File file5_5) {
        this.file5_5 = file5_5;
    }

    public void setFile5_6(File file5_6) {
        this.file5_6 = file5_6;
    }

    public void setFile5_7(File file5_7) {
        this.file5_7 = file5_7;
    }

    public void setFile5_8(File file5_8) {
        this.file5_8 = file5_8;
    }

    public void setFile5_9(File file5_9) {
        this.file5_9 = file5_9;
    }

    public void setFile5_10(File file5_10) {
        this.file5_10 = file5_10;
    }

    public void setFile6_1(File file6_1) {
        this.file6_1 = file6_1;
    }

    public void setFile6_2(File file6_2) {
        this.file6_2 = file6_2;
    }

    public void setFile6_3(File file6_3) {
        this.file6_3 = file6_3;
    }

    public void setFile6_4(File file6_4) {
        this.file6_4 = file6_4;
    }

    public void setFile6_5(File file6_5) {
        this.file6_5 = file6_5;
    }

    public void setFile6_6(File file6_6) {
        this.file6_6 = file6_6;
    }

    public void setFile6_7(File file6_7) {
        this.file6_7 = file6_7;
    }

    public void setFile6_8(File file6_8) {
        this.file6_8 = file6_8;
    }

    public void setFile6_9(File file6_9) {
        this.file6_9 = file6_9;
    }

    public void setFile6_10(File file6_10) {
        this.file6_10 = file6_10;
    }

    public void setFile7_1(File file7_1) {
        this.file7_1 = file7_1;
    }

    public void setFile7_2(File file7_2) {
        this.file7_2 = file7_2;
    }

    public void setFile7_3(File file7_3) {
        this.file7_3 = file7_3;
    }

    public void setFile7_4(File file7_4) {
        this.file7_4 = file7_4;
    }

    public void setFile7_5(File file7_5) {
        this.file7_5 = file7_5;
    }

    public void setFile7_6(File file7_6) {
        this.file7_6 = file7_6;
    }

    public void setFile7_7(File file7_7) {
        this.file7_7 = file7_7;
    }

    public void setFile7_8(File file7_8) {
        this.file7_8 = file7_8;
    }

    public void setFile7_9(File file7_9) {
        this.file7_9 = file7_9;
    }

    public void setFile7_10(File file7_10) {
        this.file7_10 = file7_10;
    }

    public void setFile8_1(File file8_1) {
        this.file8_1 = file8_1;
    }

    public void setFile8_2(File file8_2) {
        this.file8_2 = file8_2;
    }

    public void setFile8_3(File file8_3) {
        this.file8_3 = file8_3;
    }

    public void setFile8_4(File file8_4) {
        this.file8_4 = file8_4;
    }

    public void setFile8_5(File file8_5) {
        this.file8_5 = file8_5;
    }

    public void setFile8_6(File file8_6) {
        this.file8_6 = file8_6;
    }

    public void setFile8_7(File file8_7) {
        this.file8_7 = file8_7;
    }

    public void setFile8_8(File file8_8) {
        this.file8_8 = file8_8;
    }

    public void setFile8_9(File file8_9) {
        this.file8_9 = file8_9;
    }

    public void setFile8_10(File file8_10) {
        this.file8_10 = file8_10;
    }

    public void setFile9_1(File file9_1) {
        this.file9_1 = file9_1;
    }

    public void setFile9_2(File file9_2) {
        this.file9_2 = file9_2;
    }

    public void setFile9_3(File file9_3) {
        this.file9_3 = file9_3;
    }

    public void setFile9_4(File file9_4) {
        this.file9_4 = file9_4;
    }

    public void setFile9_5(File file9_5) {
        this.file9_5 = file9_5;
    }

    public void setFile9_6(File file9_6) {
        this.file9_6 = file9_6;
    }

    public void setFile9_7(File file9_7) {
        this.file9_7 = file9_7;
    }

    public void setFile9_8(File file9_8) {
        this.file9_8 = file9_8;
    }

    public void setFile9_9(File file9_9) {
        this.file9_9 = file9_9;
    }

    public void setFile9_10(File file9_10) {
        this.file9_10 = file9_10;
    }

    public void setFile10_1(File file10_1) {
        this.file10_1 = file10_1;
    }

    public void setFile10_2(File file10_2) {
        this.file10_2 = file10_2;
    }

    public void setFile10_3(File file10_3) {
        this.file10_3 = file10_3;
    }

    public void setFile10_4(File file10_4) {
        this.file10_4 = file10_4;
    }

    public void setFile10_5(File file10_5) {
        this.file10_5 = file10_5;
    }

    public void setFile10_6(File file10_6) {
        this.file10_6 = file10_6;
    }

    public void setFile10_7(File file10_7) {
        this.file10_7 = file10_7;
    }

    public void setFile10_8(File file10_8) {
        this.file10_8 = file10_8;
    }

    public void setFile10_9(File file10_9) {
        this.file10_9 = file10_9;
    }

    public void setFile10_10(File file10_10) {
        this.file10_10 = file10_10;
    }

    public void setFile11_1(File file11_1) {
        this.file11_1 = file11_1;
    }

    public void setFile11_2(File file11_2) {
        this.file11_2 = file11_2;
    }

    public void setFile11_3(File file11_3) {
        this.file11_3 = file11_3;
    }

    public void setFile11_4(File file11_4) {
        this.file11_4 = file11_4;
    }

    public void setFile11_5(File file11_5) {
        this.file11_5 = file11_5;
    }

    public void setFile11_6(File file11_6) {
        this.file11_6 = file11_6;
    }

    public void setFile11_7(File file11_7) {
        this.file11_7 = file11_7;
    }

    public void setFile11_8(File file11_8) {
        this.file11_8 = file11_8;
    }

    public void setFile11_9(File file11_9) {
        this.file11_9 = file11_9;
    }

    public void setFile11_10(File file11_10) {
        this.file11_10 = file11_10;
    }

    public void setFile12_1(File file12_1) {
        this.file12_1 = file12_1;
    }

    public void setFile12_2(File file12_2) {
        this.file12_2 = file12_2;
    }

    public void setFile12_3(File file12_3) {
        this.file12_3 = file12_3;
    }

    public void setFile12_4(File file12_4) {
        this.file12_4 = file12_4;
    }

    public void setFile12_5(File file12_5) {
        this.file12_5 = file12_5;
    }

    public void setFile12_6(File file12_6) {
        this.file12_6 = file12_6;
    }

    public void setFile12_7(File file12_7) {
        this.file12_7 = file12_7;
    }

    public void setFile12_8(File file12_8) {
        this.file12_8 = file12_8;
    }

    public void setFile12_9(File file12_9) {
        this.file12_9 = file12_9;
    }

    public void setFile12_10(File file12_10) {
        this.file12_10 = file12_10;
    }

    public void setFile13_1(File file13_1) {
        this.file13_1 = file13_1;
    }

    public void setFile13_2(File file13_2) {
        this.file13_2 = file13_2;
    }

    public void setFile13_3(File file13_3) {
        this.file13_3 = file13_3;
    }

    public void setFile13_4(File file13_4) {
        this.file13_4 = file13_4;
    }

    public void setFile13_5(File file13_5) {
        this.file13_5 = file13_5;
    }

    public void setFile13_6(File file13_6) {
        this.file13_6 = file13_6;
    }

    public void setFile13_7(File file13_7) {
        this.file13_7 = file13_7;
    }

    public void setFile13_8(File file13_8) {
        this.file13_8 = file13_8;
    }

    public void setFile13_9(File file13_9) {
        this.file13_9 = file13_9;
    }

    public void setFile13_10(File file13_10) {
        this.file13_10 = file13_10;
    }
    public List<String> getImage_str_list() {
        return image_str_list;
    }
    public void setImage_str_list(List<String> image_str_list) {
        this.image_str_list = image_str_list;
    }
    public void setFile14_1(File file14_1) {
        this.file14_1 = file14_1;
    }
    public void setFile14_2(File file14_2) {
        this.file14_2 = file14_2;
    }
    public void setFile14_3(File file14_3) {
        this.file14_3 = file14_3;
    }
    public void setFile14_4(File file14_4) {
        this.file14_4 = file14_4;
    }
    public void setFile14_5(File file14_5) {
        this.file14_5 = file14_5;
    }
    public void setFile14_6(File file14_6) {
        this.file14_6 = file14_6;
    }
    public void setFile14_7(File file14_7) {
        this.file14_7 = file14_7;
    }
    public void setFile14_8(File file14_8) {
        this.file14_8 = file14_8;
    }
    public void setFile14_9(File file14_9) {
        this.file14_9 = file14_9;
    }
    public void setFile14_10(File file14_10) {
        this.file14_10 = file14_10;
    }
    public void setFile15_1(File file15_1) {
        this.file15_1 = file15_1;
    }
    public void setFile15_2(File file15_2) {
        this.file15_2 = file15_2;
    }
    public void setFile15_3(File file15_3) {
        this.file15_3 = file15_3;
    }
    public void setFile15_4(File file15_4) {
        this.file15_4 = file15_4;
    }
    public void setFile15_5(File file15_5) {
        this.file15_5 = file15_5;
    }
    public void setFile15_6(File file15_6) {
        this.file15_6 = file15_6;
    }
    public void setFile15_7(File file15_7) {
        this.file15_7 = file15_7;
    }
    public void setFile15_8(File file15_8) {
        this.file15_8 = file15_8;
    }
    public void setFile15_9(File file15_9) {
        this.file15_9 = file15_9;
    }
    public void setFile15_10(File file15_10) {
        this.file15_10 = file15_10;
    }
    public void setFile16_1(File file16_1) {
        this.file16_1 = file16_1;
    }
    public void setFile16_2(File file16_2) {
        this.file16_2 = file16_2;
    }
    public void setFile16_3(File file16_3) {
        this.file16_3 = file16_3;
    }
    public void setFile16_4(File file16_4) {
        this.file16_4 = file16_4;
    }
    public void setFile16_5(File file16_5) {
        this.file16_5 = file16_5;
    }
    public void setFile16_6(File file16_6) {
        this.file16_6 = file16_6;
    }
    public void setFile16_7(File file16_7) {
        this.file16_7 = file16_7;
    }
    public void setFile16_8(File file16_8) {
        this.file16_8 = file16_8;
    }
    public void setFile16_9(File file16_9) {
        this.file16_9 = file16_9;
    }
    public void setFile16_10(File file16_10) {
        this.file16_10 = file16_10;
    }
    public void setFile17_1(File file17_1) {
        this.file17_1 = file17_1;
    }
    public void setFile17_2(File file17_2) {
        this.file17_2 = file17_2;
    }
    public void setFile17_3(File file17_3) {
        this.file17_3 = file17_3;
    }
    public void setFile17_4(File file17_4) {
        this.file17_4 = file17_4;
    }
    public void setFile17_5(File file17_5) {
        this.file17_5 = file17_5;
    }
    public void setFile17_6(File file17_6) {
        this.file17_6 = file17_6;
    }
    public void setFile17_7(File file17_7) {
        this.file17_7 = file17_7;
    }
    public void setFile17_8(File file17_8) {
        this.file17_8 = file17_8;
    }
    public void setFile17_9(File file17_9) {
        this.file17_9 = file17_9;
    }
    public void setFile17_10(File file17_10) {
        this.file17_10 = file17_10;
    }
    public void setFile18_1(File file18_1) {
        this.file18_1 = file18_1;
    }
    public void setFile18_2(File file18_2) {
        this.file18_2 = file18_2;
    }
    public void setFile18_3(File file18_3) {
        this.file18_3 = file18_3;
    }
    public void setFile18_4(File file18_4) {
        this.file18_4 = file18_4;
    }
    public void setFile18_5(File file18_5) {
        this.file18_5 = file18_5;
    }
    public void setFile18_6(File file18_6) {
        this.file18_6 = file18_6;
    }
    public void setFile18_7(File file18_7) {
        this.file18_7 = file18_7;
    }
    public void setFile18_8(File file18_8) {
        this.file18_8 = file18_8;
    }
    public void setFile18_9(File file18_9) {
        this.file18_9 = file18_9;
    }
    public void setFile18_10(File file18_10) {
        this.file18_10 = file18_10;
    }
    public void setFile19_1(File file19_1) {
        this.file19_1 = file19_1;
    }
    public void setFile19_2(File file19_2) {
        this.file19_2 = file19_2;
    }
    public void setFile19_3(File file19_3) {
        this.file19_3 = file19_3;
    }
    public void setFile19_4(File file19_4) {
        this.file19_4 = file19_4;
    }
    public void setFile19_5(File file19_5) {
        this.file19_5 = file19_5;
    }
    public void setFile19_6(File file19_6) {
        this.file19_6 = file19_6;
    }
    public void setFile19_7(File file19_7) {
        this.file19_7 = file19_7;
    }
    public void setFile19_8(File file19_8) {
        this.file19_8 = file19_8;
    }
    public void setFile19_9(File file19_9) {
        this.file19_9 = file19_9;
    }
    public void setFile19_10(File file19_10) {
        this.file19_10 = file19_10;
    }
    
}
